home *** CD-ROM | disk | FTP | other *** search
/ Hyper Stacks 1994 May / Hyper Stacks (Pacific HiTech)(1994)[Mac].iso / Science / Biology / bufstack Folder / BufferStack 1.1 / background_3161.txt < prev    next >
Encoding:
Text File  |  1989-11-13  |  22.0 KB  |  798 lines

  1. -- background: 3161 from stack: in.1
  2. -- bmap block id: 6884
  3. -- flags: 4000
  4. -- background id: 0
  5. -- name: 
  6. ----- HyperTalk script -----
  7. on openBackground
  8.   push recent card
  9. end openBackground
  10.  
  11.  
  12. -- part 8 (button)
  13. -- low flags: 00
  14. -- high flags: 2000
  15. -- rect: left=450 top=178 right=203 bottom=481
  16. -- title width / last selected line: 0
  17. -- icon id / first selected line: 21700 / 21700
  18. -- text alignment: 1
  19. -- font id: 0
  20. -- text size: 12
  21. -- style flags: 0
  22. -- line height: 16
  23. -- part name: Home
  24. ----- HyperTalk script -----
  25. on mouseUp
  26.   visual effect iris open
  27.   go Home
  28. end mouseUp
  29.  
  30.  
  31.  
  32. -- part 11 (field)
  33. -- low flags: 01
  34. -- high flags: 2000
  35. -- rect: left=55 top=61 right=83 bottom=333
  36. -- title width / last selected line: 0
  37. -- icon id / first selected line: 0 / 0
  38. -- text alignment: 0
  39. -- font id: 0
  40. -- text size: 12
  41. -- style flags: 0
  42. -- line height: 16
  43. -- part name: Name
  44.  
  45.  
  46. -- part 12 (field)
  47. -- low flags: 00
  48. -- high flags: 2002
  49. -- rect: left=396 top=61 right=81 bottom=446
  50. -- title width / last selected line: 0
  51. -- icon id / first selected line: 0 / 0
  52. -- text alignment: 0
  53. -- font id: 21
  54. -- text size: 12
  55. -- style flags: 0
  56. -- line height: 12
  57. -- part name: pH
  58.  
  59.  
  60. -- part 13 (field)
  61. -- low flags: 00
  62. -- high flags: 2002
  63. -- rect: left=249 top=124 right=143 bottom=288
  64. -- title width / last selected line: 0
  65. -- icon id / first selected line: 0 / 0
  66. -- text alignment: 0
  67. -- font id: 21
  68. -- text size: 12
  69. -- style flags: 0
  70. -- line height: 12
  71. -- part name: I
  72.  
  73.  
  74. -- part 14 (field)
  75. -- low flags: 00
  76. -- high flags: 2002
  77. -- rect: left=271 top=86 right=106 bottom=342
  78. -- title width / last selected line: 0
  79. -- icon id / first selected line: 0 / 0
  80. -- text alignment: 0
  81. -- font id: 21
  82. -- text size: 12
  83. -- style flags: 0
  84. -- line height: 12
  85. -- part name: Conc
  86.  
  87.  
  88. -- part 15 (field)
  89. -- low flags: 00
  90. -- high flags: 2002
  91. -- rect: left=398 top=225 right=245 bottom=448
  92. -- title width / last selected line: 0
  93. -- icon id / first selected line: 0 / 0
  94. -- text alignment: 0
  95. -- font id: 21
  96. -- text size: 12
  97. -- style flags: 0
  98. -- line height: 12
  99. -- part name: T
  100.  
  101.  
  102. -- part 16 (button)
  103. -- low flags: 00
  104. -- high flags: A006
  105. -- rect: left=339 top=141 right=162 bottom=392
  106. -- title width / last selected line: 0
  107. -- icon id / first selected line: 0 / 0
  108. -- text alignment: 1
  109. -- font id: 0
  110. -- text size: 12
  111. -- style flags: 0
  112. -- line height: 16
  113. -- part name: NaCl
  114. ----- HyperTalk script -----
  115. on mouseUp
  116.   set the highlight of background button "Other salt" to false
  117.   set the highlight of background button "KCl" to false
  118.   set the highlight of background button "NaCl" to true
  119.   set the highlight of background button "Na2SO4" to false
  120. end mouseUp
  121.  
  122.  
  123. -- part 17 (button)
  124. -- low flags: 00
  125. -- high flags: A006
  126. -- rect: left=339 top=121 right=142 bottom=382
  127. -- title width / last selected line: 0
  128. -- icon id / first selected line: 0 / 0
  129. -- text alignment: 1
  130. -- font id: 0
  131. -- text size: 12
  132. -- style flags: 0
  133. -- line height: 16
  134. -- part name: KCl
  135. ----- HyperTalk script -----
  136. on mouseUp
  137.   set the highlight of background button "Other salt" to false
  138.   set the highlight of background button "KCl" to true
  139.   set the highlight of background button "NaCl" to false
  140.   set the highlight of background button "Na2SO4" to false
  141. end mouseUp
  142.  
  143.  
  144.  
  145. -- part 18 (button)
  146. -- low flags: 00
  147. -- high flags: 2006
  148. -- rect: left=391 top=121 right=142 bottom=462
  149. -- title width / last selected line: 0
  150. -- icon id / first selected line: 0 / 0
  151. -- text alignment: 1
  152. -- font id: 0
  153. -- text size: 12
  154. -- style flags: 0
  155. -- line height: 16
  156. -- part name: Na2SO4
  157. ----- HyperTalk script -----
  158. on mouseUp
  159.   set the highlight of background button "Other salt" to false
  160.   set the highlight of background button "KCl" to false
  161.   set the highlight of background button "NaCl" to false
  162.   set the highlight of background button "Na2SO4" to true
  163. end mouseUp
  164.  
  165.  
  166. -- part 31 (field)
  167. -- low flags: 81
  168. -- high flags: 2007
  169. -- rect: left=349 top=249 right=280 bottom=473
  170. -- title width / last selected line: 0
  171. -- icon id / first selected line: 0 / 0
  172. -- text alignment: 0
  173. -- font id: 22
  174. -- text size: 10
  175. -- style flags: 0
  176. -- line height: 13
  177. -- part name: DH
  178.  
  179.  
  180. -- part 30 (field)
  181. -- low flags: 01
  182. -- high flags: 0002
  183. -- rect: left=13 top=182 right=289 bottom=261
  184. -- title width / last selected line: 0
  185. -- icon id / first selected line: 0 / 0
  186. -- text alignment: 0
  187. -- font id: 3
  188. -- text size: 9
  189. -- style flags: 0
  190. -- line height: 12
  191. -- part name: BufferInfo
  192.  
  193.  
  194. -- part 36 (button)
  195. -- low flags: 00
  196. -- high flags: 6005
  197. -- rect: left=17 top=145 right=160 bottom=33
  198. -- title width / last selected line: 0
  199. -- icon id / first selected line: 0 / 0
  200. -- text alignment: 1
  201. -- font id: 0
  202. -- text size: 12
  203. -- style flags: 0
  204. -- line height: 16
  205. -- part name: FreeI
  206. ----- HyperTalk script -----
  207. on mouseUp
  208.   set the highlight of background button "FreeI" to true
  209.   set the highlight of background button "FixI" to false
  210.   put empty into field "I"
  211.   set the highlight of background button "KCl" to false
  212.   set the highlight of background button "NaCl" to false
  213.   set the highlight of background button "Na2SO4" to false
  214.   set the highlight of background button "Other salt" to false
  215. end mouseUp
  216.  
  217.  
  218.  
  219. -- part 37 (button)
  220. -- low flags: 00
  221. -- high flags: 2005
  222. -- rect: left=17 top=124 right=140 bottom=34
  223. -- title width / last selected line: 0
  224. -- icon id / first selected line: 0 / 0
  225. -- text alignment: 1
  226. -- font id: 0
  227. -- text size: 12
  228. -- style flags: 0
  229. -- line height: 16
  230. -- part name: FixI
  231. ----- HyperTalk script -----
  232. on mouseUp
  233.   set the highlight of background button "FreeI" to false
  234.   set the highlight of background button "FixI" to true
  235. end mouseUp
  236.  
  237.  
  238.  
  239. -- part 43 (field)
  240. -- low flags: 00
  241. -- high flags: 2002
  242. -- rect: left=396 top=86 right=106 bottom=446
  243. -- title width / last selected line: 0
  244. -- icon id / first selected line: 0 / 0
  245. -- text alignment: 1
  246. -- font id: 21
  247. -- text size: 12
  248. -- style flags: 0
  249. -- line height: 12
  250. -- part name: Volume
  251.  
  252.  
  253. -- part 44 (button)
  254. -- low flags: 00
  255. -- high flags: A003
  256. -- rect: left=272 top=295 right=316 bottom=372
  257. -- title width / last selected line: 0
  258. -- icon id / first selected line: 0 / 0
  259. -- text alignment: 1
  260. -- font id: 0
  261. -- text size: 12
  262. -- style flags: 0
  263. -- line height: 16
  264. -- part name: Edit buffers
  265. ----- HyperTalk script -----
  266. on mouseUp
  267.   ask password "Enter password to edit buffers"
  268.   if it <> 3246591934 then
  269.     exit mouseUp
  270.   else
  271.     answer "What editing ?" with "New" or "Edit" or "Done"
  272.     if it is "New" then
  273.       put the script of this card into tempscript
  274.       domenu new card
  275.       put "(Name of buffer)" & return after field BufferInfo
  276.       put "pKa is ??.??"  & return after field BufferInfo
  277.       put "dpK/dT is ????"  & return after field BufferInfo
  278.       put "charge on acid species is ??"  & return after field BufferInfo
  279.       put "made from ????????????"  & return after field BufferInfo
  280.       put "Mol.wt. is ???.??"  & return after field BufferInfo
  281.       put "Shortname is ?????" & return after field BufferInfo
  282.       put "Notes: (free format-1 line max)" & return after field BufferInfo
  283.       set the script of this card to tempscript
  284.       set the lockText of background field "BufferInfo" to false
  285.     else
  286.       if it is "Edit" then
  287.         set the lockText of background field "BufferInfo" to false
  288.       else
  289.         if it is "Done" then set the lockText of background field "BufferInfo" to true
  290.         put line 1 of field BufferInfo into field Name
  291.       end if
  292.     end if
  293.   end if
  294. end mouseUp
  295.  
  296.  
  297.  
  298. -- part 46 (button)
  299. -- low flags: 00
  300. -- high flags: 2001
  301. -- rect: left=10 top=292 right=320 bottom=40
  302. -- title width / last selected line: 0
  303. -- icon id / first selected line: 9301 / 9301
  304. -- text alignment: 1
  305. -- font id: 0
  306. -- text size: 12
  307. -- style flags: 0
  308. -- line height: 16
  309. -- part name: Previous
  310. ----- HyperTalk script -----
  311. on mouseUp
  312.   visual effect dissolve
  313.   go to previous card
  314. end mouseUp
  315.  
  316.  
  317.  
  318. -- part 48 (button)
  319. -- low flags: 00
  320. -- high flags: 2001
  321. -- rect: left=458 top=294 right=320 bottom=491
  322. -- title width / last selected line: 0
  323. -- icon id / first selected line: 27009 / 27009
  324. -- text alignment: 1
  325. -- font id: 0
  326. -- text size: 12
  327. -- style flags: 0
  328. -- line height: 16
  329. -- part name: Next
  330. ----- HyperTalk script -----
  331. on mouseUp
  332.   put the number of this card into n
  333.   put the number of cards into s
  334.   if n=s then
  335.     beep
  336.   else
  337.     visual effect dissolve
  338.     go to next card
  339.   end if
  340. end mouseUp
  341.  
  342.  
  343.  
  344. -- part 22 (button)
  345. -- low flags: 00
  346. -- high flags: A003
  347. -- rect: left=377 top=295 right=316 bottom=445
  348. -- title width / last selected line: 0
  349. -- icon id / first selected line: 0 / 0
  350. -- text alignment: 1
  351. -- font id: 0
  352. -- text size: 12
  353. -- style flags: 0
  354. -- line height: 16
  355. -- part name: Recipe
  356. ----- HyperTalk script -----
  357. function DebyeHuckel T
  358. -- use a second order polynomial to approximate (*very* closely)
  359. -- the Debye H√ºckel parameter at any temperature
  360. put (0.4918 + 0.0006614*T + 0.000004975*T^2) into DH
  361. return DH
  362. end DebyeHuckel
  363.  
  364. function CalculateI pH,pK,z,Conc
  365. --
  366. -- calculate the ionic strength due to all buffer species
  367. -- N.B. assumes that all counterions are monovalent
  368. -- e.g. Na+,K+,Cl-
  369. -- z = charge on acid species
  370. -- Conc = total concentration of all buffer species
  371. -- I = ionic strength due to buffer species
  372. --
  373. put 10^(pH-pK) into R
  374. put (R/(1+R) * Conc * (z-1)^2) into I1  -- basic species
  375. put (1/(1+R) * Conc * z^2) into I2      -- acidic species
  376. put (R/(1+R) * Conc * abs(z-1)) into I3 -- counterion to basic species
  377. put (1/(1+R) * Conc * abs(z)) into I4   -- counterion, acidic species
  378. put (I1 + I2 + I3 + I4)/2 into I
  379. return I
  380. end CalculateI
  381.  
  382. function CalculateNewpKa pK,I,T,z
  383. -- calculates the pKa' from pKa according to
  384. -- Debye-H√ºckel modifications
  385. -- T = temperature in centigrade
  386. put DebyeHuckel(T) into A
  387. put A * sqrt(I) into corr
  388. --
  389. --       this is anternative formula sometimes used
  390. --       replacing next three lines
  391. --       put corr * (-2*z+1) into corr1
  392. --       put corr1/(1+1.6*sqrt(I)) into corr1
  393. --
  394. put corr/(1 + sqrt(I)) into corr1
  395. put corr1 - (0.1 * I) into corr1
  396. put corr1 * (2*z - 1) into corr1
  397. --
  398. put pK + corr1 into P
  399. return P
  400. end CalculateNewpKa
  401.  
  402. on mouseUp
  403.   -- range checking - valid buffer requested?
  404.  
  405.   if background field "T" is empty then
  406.     ask "At what temperature will you use the buffer ?" with "37.4"
  407.     put it into background field "T"
  408.   end if
  409.  
  410.   if background field "LabT" is empty then put 20 into background field "LabT"
  411.  
  412.   if background field "Volume" is empty then put 1000 into background field "Volume"
  413.  
  414.   if background field "pH" is empty then
  415.     ask "What pH will the buffer be ?"
  416.     put it into background field "pH"
  417.     if it is empty then exit mouseUp
  418.   end if
  419.  
  420.   if background field "Conc" is empty then
  421.     ask "What buffer concentration (M) ?"
  422.     put it into background field "Conc"
  423.     if it is empty then exit mouseUp
  424.   end if
  425.  
  426.   if background field "I" is empty then
  427.     put "FreeI" into BufferType
  428.     set the highlight of background button "FreeI" to true
  429.     set the highlight of background button "FixI" to false
  430.   else
  431.     put "NoFreeI" into BufferType
  432.     set the highlight of background button "FreeI" to false
  433.     set the highlight of background button "FixI" to true
  434.   end if
  435.  
  436.   -- get the current buffer parameters
  437.  
  438.   put background field  "pH" into pH
  439.   put background field "T" into T
  440.   put background field "Conc" into C
  441.   put background field "I" into I
  442.   put background field "Volume" into V
  443.   put background field "LabT" into LabT
  444.  
  445.   -- get the current buffer properties
  446.   -- there is no syntax checking - so care with buffer details!
  447.  
  448.   -- get buffer name
  449.   put line 1 of field "BufferInfo" into BufferName
  450.   -- get thermodynamic pKa
  451.   put word 3 of line 2 of field "BufferInfo" into pKa
  452.   -- get temperature coefficient
  453.   put word 3 of line 3 of field "BufferInfo" into dpKadT
  454.   -- get charge on acidic species (for this ionisation)
  455.   put word 6 of line 4 of field "BufferInfo" into za
  456.   -- get the material used to make buffer
  457.   put word 3 of line 5 of field "BufferInfo" into BufferStuff
  458.   -- get the molecuar weight of same
  459.   put word 3 of line 6 of field "BufferInfo" into MW
  460.   -- get a short name for convenience
  461.   put word 3 of line 7 of field "BufferInfo" into ShortName
  462.   -- get any notes appended to bufer
  463.   put line 8 of field "BufferInfo" into Notes
  464.  
  465.   -- range check Conc, I, pH and T requested
  466.   -- (checks conducted before pKa - > pK', though)
  467.  
  468.   if abs (pH-pKa) > 1.0 then
  469.     answer "This buffer is not appropriate, pKa=" && pKa
  470.     exit mouseUp
  471.   else
  472.     if abs (pH-pKa) > 0.8 then
  473.       answer "This buffer is only just OK, pKa=" && pKa with "Go ahead"
  474.       if it is "Cancel" then  exit MouseUp
  475.     end if
  476.   end if
  477.  
  478.   if (T<0 or T>60) then
  479.     answer T && "¬∞C is outside the useable range of 0-60¬∞C"
  480.     exit MouseUp
  481.   end if
  482.  
  483.   if BufferType is "FreeI" then
  484.     set the highlight of background button "KCl" to false
  485.     set the highlight of background button "NaCl" to false
  486.     set the highlight of background button "Na2SO4" to false
  487.     set the highlight of background button "Other salt" to false
  488.   end if
  489.  
  490.   put empty into field "v"
  491.   show field "v"
  492.   hide background button "Recipe"
  493.   show background button "OK"
  494.   hide background button "Help!"
  495.   hide background button "Tutorial"
  496.   show background button "Save to disk"
  497.   show background button "Edit buffers"
  498.   set numberFormat to 0.000
  499.  
  500.   -- now have all parameters set up
  501.   -- modify pKa for temperature
  502.  
  503.   put (pKa + dpKadT*(T-25)) into pKaPrime
  504.  
  505.   if BufferType is "FreeI" then
  506.     -- here if we don't want to control ionic strength
  507.     put pkaPrime into pK1
  508.     put 1000 into diff -- a big number
  509.     set cursor to busy
  510.     repeat until diff < 0.001
  511.       set cursor to busy
  512.       put CalculateI(pH,pK1,za,C) into I
  513.       put CalculateNewpKa(pKaPrime,I,T,za) into pK2
  514.       put abs (pK1 - pK2) into diff
  515.       put pK2 into pK1
  516.     end repeat
  517.  
  518.     -- pKa is original pK value (thermodynamic)
  519.     -- pKaPrime is the temperature corrected pKa
  520.     -- pK2 is the ionic strength corrected value
  521.     -- I is the ionic stength
  522.  
  523.     -- how much buffer stuff ?
  524.  
  525.     put C * MW * V/1000 into Weight
  526.  
  527.     -- work out pH at lab temperature (approx)
  528.  
  529.     put (pK2 + dpKadT*(LabT-T)) into LabpKa
  530.     put 10^(pH-pK2) into R
  531.     put LabpKa + ln(R)/2.3 into LabpH
  532.  
  533.     -- ready for recipe
  534.  
  535.     put "Buffer recipe " & the long date & return into field "v"
  536.     put return after field "v"
  537.     put "Buffer : " & C & "M " & BufferName & " pH " & pH & " at T=" & T & " ¬∞C" & return after field "v"
  538.     put "     pH: " & LabpH & " at lab temperature of " & LabT & " ¬∞C" & return after field "v"
  539.     put return after field "v"
  540.     put "      T: " & T & "¬∞C" & return after field "v"
  541.     put "    pKa: " & pKa & ",   pKa': " & pK2 & "  (dpKa/dT: " & dpKadT & ")" & return after field "v"
  542.     put "      I: " & I & " (Ionic strength due to buffer components)" & return after field "v"
  543.     put "  " & Notes & return after field "v"
  544.     put return after field "v"
  545.     put "1. Dissolve " & Weight & "g " & BufferStuff & return after field "v"
  546.     put "   in       ~" & V*0.8 & " ml double distilled water." & return & return after field "v"
  547.     put "2. Titrate to pH " & LabpH & " with monobasic acid or alkali." & return & return after field "v"
  548.     put "3. Make up to " & V & "mls" & return after field "v"
  549.     put "" & return after field "v"
  550.  
  551.   else
  552.     -- here if we do control ionic strength
  553.     -- I is the specified ionic strength
  554.  
  555.     put empty into field "v"
  556.     if (the highlight of background button "KCl" is false and the highlight of background button "NaCl" is false and the highlight of background button "Na2SO4" is false and the highlight of background button "Other salt" is false) then
  557.       set the highlight of background button "NaCl" to true
  558.     end if
  559.  
  560.     if the highlight of background button "Other salt" is true then
  561.       put "other salt" into SaltName
  562.       put 74.56 into SaltMW -- these are dummy parameters
  563.       put 1 into SaltF      -- so is this
  564.     end if
  565.  
  566.     if the highlight of background button "KCl" is true then
  567.       put "KCl" into SaltName
  568.       put 74.56 into SaltMW
  569.       put 1 into SaltF
  570.     end if
  571.  
  572.     if the highlight of background button "NaCl" is true then
  573.       put "NaCl" into SaltName
  574.       put 58.44 into SaltMW
  575.       put 1 into SaltF
  576.     end if
  577.  
  578.     if the highlight of background button "Na2SO4" is true then
  579.       put "Na2SO4" into SaltName
  580.       put 142.04 into SaltMW
  581.       put 3 into SaltF
  582.     end if
  583.  
  584.     put CalculateNewpKa(pKaPrime,I,T,za) into pK2
  585.     put calculateI(pH,pk2,za,C) into Icalc
  586.     if Icalc > I then
  587.       answer "Calculated I of this buffer is too large I!"
  588.       exit MouseUp
  589.  
  590.  
  591.     else
  592.  
  593.       put C * MW * V/1000 into Weight
  594.  
  595.       -- work out pH at lab temperature (approx)
  596.  
  597.       put (pK2 + dpKadT*(LabT-T)) into LabpKa
  598.       put 10^(pH-pK2) into R
  599.       put LabpKa + ln(R)/2.3 into LabpH
  600.  
  601.  
  602.       put (I-Icalc) into saltI
  603.       put (saltI/SaltF) into SaltM
  604.       put SaltM * SaltMW * V/1000 into SaltWeight
  605.       put "Buffer recipe " & the long date & return into field "v"
  606.       put return after field "v"
  607.       put "Buffer : " & C & "M " & BufferName & " pH " & pH & " at T=" & T & " ¬∞C" & return after field "v"
  608.       put "     pH: " & LabpH & " at lab temperature of " & LabT & " ¬∞C" & return after field "v"
  609.       put return after field "v"
  610.       put return after field "v"
  611.       put "     pH: " & pH & return after field "v"
  612.       put "      T: " & T & "¬∞C" & return after field "v"
  613.       put "    pKa: " & pKa & ",   pKa': " & pK2 & "  (dpKa/dT: " & dpKadT & ")" & return after field "v"
  614.       if the highlight of background button "Other salt" is false then
  615.         put "      I: " & I & " (Maintained with " & SaltM & "M " & SaltName & " to I= " & saltI & ")" & return after field "v"
  616.       else
  617.         put "      I: " & I & " (Maintained with " & SaltName & " to I= " & saltI & ")" & return after field "v"
  618.       end if
  619.       put "  " & Notes & return after field "v"
  620.       put return after field "v"
  621.  
  622.       if the highlight of background button "Other salt" is true then
  623.         put "1. Dissolve " & Weight & "g " & BufferStuff & return after field "v"
  624.         put "   and       a salt to I= " & saltI & return after field "v"
  625.         put "   in        ~" & V*0.8 & " ml double distilled water." & return & return after field "v"
  626.       else
  627.         put "1. Dissolve " & Weight & "g " & BufferStuff & return after field "v"
  628.         put "   and      " & SaltWeight & "g "& SaltName & return after field "v"
  629.         put "   in       ~" & V*0.8 & " ml double distilled water." & return & return after field "v"
  630.       end if
  631.       put "2. Titrate to pH " & LabpH & " with monobasic acid or alkali." & return & return after field "v"
  632.       put "3. Make up to " & V & "mls" & return after field "v"
  633.       put "" & return after field "v"
  634.     end if
  635.   end if
  636. end mouseUp
  637.  
  638.  
  639.  
  640.  
  641. -- part 19 (button)
  642. -- low flags: 80
  643. -- high flags: 8003
  644. -- rect: left=272 top=295 right=316 bottom=372
  645. -- title width / last selected line: 0
  646. -- icon id / first selected line: 0 / 0
  647. -- text alignment: 1
  648. -- font id: 0
  649. -- text size: 12
  650. -- style flags: 0
  651. -- line height: 16
  652. -- part name: Save to disk
  653. ----- HyperTalk script -----
  654. Global ShortName
  655. on mouseUp
  656.   put word 3 of line 7 of field "BufferInfo" & "/pH=" & field "pH" & "/I=" & field "I" & "/T=" & field "T" into filename
  657.   ask "What filename for this buffer?" with filename
  658.   if it is empty then exit mouseUp
  659.   put it into filename
  660.   open file filename
  661.   write "=======================================" & field "Name" & space & field "pH" & return to file filename
  662.   write return to file filename
  663.   write field "v" to file filename
  664.   write return to file filename
  665.   write "=======================================" to file filename
  666.   close file filename
  667.   answer "On disk as: " & filename
  668. end mouseUp
  669.  
  670.  
  671.  
  672. -- part 27 (button)
  673. -- low flags: 80
  674. -- high flags: 8003
  675. -- rect: left=377 top=295 right=316 bottom=445
  676. -- title width / last selected line: 0
  677. -- icon id / first selected line: 0 / 0
  678. -- text alignment: 1
  679. -- font id: 0
  680. -- text size: 12
  681. -- style flags: 0
  682. -- line height: 16
  683. -- part name: OK
  684. ----- HyperTalk script -----
  685. on mouseUp
  686.   hide field "v"
  687.   show background button "Recipe"
  688.   hide background button "OK"
  689.   show background button "Next"
  690.   show background button "Help!"
  691.   show background button "Previous"
  692.   hide background button "Save to disk"
  693.   show background button "Tutorial"
  694.   show background button "Edit buffers"
  695. end mouseUp
  696.  
  697.  
  698.  
  699. -- part 58 (button)
  700. -- low flags: 00
  701. -- high flags: A006
  702. -- rect: left=391 top=141 right=162 bottom=479
  703. -- title width / last selected line: 0
  704. -- icon id / first selected line: 0 / 0
  705. -- text alignment: 1
  706. -- font id: 0
  707. -- text size: 12
  708. -- style flags: 0
  709. -- line height: 16
  710. -- part name: Other salt
  711. ----- HyperTalk script -----
  712. on mouseUp
  713.   set the highlight of background button "Other salt" to true
  714.   set the highlight of background button "KCl" to false
  715.   set the highlight of background button "NaCl" to false
  716.   set the highlight of background button "Na2SO4" to false
  717. end mouseUp
  718.  
  719.  
  720. -- part 59 (field)
  721. -- low flags: 00
  722. -- high flags: 2002
  723. -- rect: left=398 top=251 right=271 bottom=448
  724. -- title width / last selected line: 0
  725. -- icon id / first selected line: 0 / 0
  726. -- text alignment: 0
  727. -- font id: 21
  728. -- text size: 12
  729. -- style flags: 0
  730. -- line height: 12
  731. -- part name: LabT
  732.  
  733.  
  734. -- part 10 (field)
  735. -- low flags: 80
  736. -- high flags: 2007
  737. -- rect: left=13 top=38 right=293 bottom=489
  738. -- title width / last selected line: 0
  739. -- icon id / first selected line: 0 / 0
  740. -- text alignment: 0
  741. -- font id: 22
  742. -- text size: 10
  743. -- style flags: 0
  744. -- line height: 13
  745. -- part name: v
  746.  
  747.  
  748. -- part 60 (button)
  749. -- low flags: 00
  750. -- high flags: A003
  751. -- rect: left=52 top=296 right=316 bottom=119
  752. -- title width / last selected line: 0
  753. -- icon id / first selected line: 0 / 0
  754. -- text alignment: 1
  755. -- font id: 0
  756. -- text size: 12
  757. -- style flags: 0
  758. -- line height: 16
  759. -- part name: Help!
  760. ----- HyperTalk script -----
  761. on mouseUp
  762.   set the visible of background field "helptext" to not the visible of background field "helptext"
  763. end mouseUp
  764.  
  765.  
  766.  
  767. -- part 61 (field)
  768. -- low flags: 80
  769. -- high flags: 0004
  770. -- rect: left=97 top=89 right=262 bottom=389
  771. -- title width / last selected line: 0
  772. -- icon id / first selected line: 0 / 0
  773. -- text alignment: 0
  774. -- font id: 3
  775. -- text size: 12
  776. -- style flags: 0
  777. -- line height: 16
  778. -- part name: helptext
  779.  
  780.  
  781. -- part 62 (button)
  782. -- low flags: 00
  783. -- high flags: 8003
  784. -- rect: left=164 top=296 right=317 bottom=263
  785. -- title width / last selected line: 0
  786. -- icon id / first selected line: 0 / 0
  787. -- text alignment: 1
  788. -- font id: 0
  789. -- text size: 12
  790. -- style flags: 0
  791. -- line height: 16
  792. -- part name: Tutorial
  793. ----- HyperTalk script -----
  794. on mouseUp
  795.   go to first card
  796. end mouseUp
  797.  
  798.